package com.bootdo.xiao.qcloudsms;

import com.bootdo.xiao.util.SmsConstants;
import com.github.qcloudsms.SmsSingleSender;
import com.github.qcloudsms.SmsSingleSenderResult;
import com.github.qcloudsms.httpclient.HTTPException;

import java.io.IOException;

import static com.bootdo.xiao.util.SmsConstants.phoneNumbers;

/**
 * @Auther: liuj
 * @Date: 2019/5/24 17:03
 * @Description:单发短信
 */
public class SingleSendSMS {
    public static void main(String[] args){
        SmsSingleSender ssender = new SmsSingleSender(SmsConstants.appid, SmsConstants.appkey);
        SmsSingleSenderResult result = null;
        try {
            result = ssender.send(0, "86", phoneNumbers[0],
                    "【腾讯云】您的验证码是: 5678", "", "");
        } catch (HTTPException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

        System.out.println(result);
    }
}
